const {
	db,
	dbCmd,
	result_success,
	result_error,
	appletInfoCollection,
	collectionCollection
} = require('../../common/constants')
module.exports = async function(params = {}) {
	const token = this.getUniIdToken()
	if (!token) {
		return result_error('登录失效,请重新登录')
	}
	let payload = await this.uniID.checkToken(token)
	if (payload.code) {
		return payload
	}
	let _id = params._id
	if (!_id) {
		return result_error('_id不存在')
	}
	await collectionCollection.doc(_id).update({
		status: '收款结束'
	})
	return result_success()
}